package br.com.fogas.webservice.service.impl;

import android.content.Context;
import br.com.fogas.utils.exception.ParseXmlException;
import br.com.fogas.webservice.exception.ERaiseWebServiceException;
import br.com.fogas.webservice.exception.RespostaWebServiceException;
import br.com.fogas.webservice.exception.SemConexaoInternetException;
import br.com.fogas.webservice.exception.ServidorForaException;
import br.com.fogas.webservice.exception.TempoEsperaRespostaException;
import br.com.fogas.webservice.exception.WebServiceException;
import br.com.fogas.webservice.parser.notafiscal.NotaFiscalRequest;
import br.com.fogas.webservice.parser.notafiscal.NotaFiscalResponse;
import br.com.fogas.webservice.repository.IRepositoryHandler;
import br.com.fogas.webservice.repository.soap.NotaFiscalRepository;
import br.com.fogas.webservice.service.IServiceHandler;

public class NotaFiscalService implements IServiceHandler<NotaFiscalResponse> {
	
	private IRepositoryHandler<NotaFiscalResponse> repository;
	
	public NotaFiscalService(Context  context, NotaFiscalRequest request) {
		this.repository = new NotaFiscalRepository(context, request);
	}

	@Override
	public NotaFiscalResponse getResponse() throws SemConexaoInternetException,
			ParseXmlException, TempoEsperaRespostaException,
			ServidorForaException, RespostaWebServiceException,
			WebServiceException, ERaiseWebServiceException {
		return repository.getResponse();
	}
}